﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="XemTinTheoQuanHuyen.aspx.cs" Inherits="WebHousingInfo.XemTinTheoQuanHuyen" %>

<%@ Register Src="~/Controls/Header.ascx" TagName="Head" TagPrefix="Header" %>
<%@ Register Src="~/Controls/MenuFooter.ascx" TagName="MeNuDuoi" TagPrefix="MenuFooter" %>
<%@ Register Src="~/Controls/Footer.ascx" TagName="Foot" TagPrefix="Footer" %>
<%@ Register Src="~/Controls/QuangCaoTren.ascx" TagName="QCT" TagPrefix="QuangCaoTren" %>
<%@ Register Src="~/Controls/DanhMucNhaChoThue.ascx" TagName="CT" TagPrefix="DanhMucNhaChoThue" %>
<%@ Register Src="~/Controls/NoiThat.ascx" TagName="NT" TagPrefix="NoiThat" %>
<%@ Register Src="~/Controls/KhongGianSong.ascx" TagName="KGS" TagPrefix="KhongGianSong" %>
<%@ Register Src="~/Controls/TimKiemTrangCon2.ascx" TagName="TK2" TagPrefix="TimKiemCon2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Thông Tin Nhà Đất Cần Bán - Cần Mua - Cần Thuê - Cho Thuê</title>
</head>
<body>
    <form id="form1" runat="server">
        <div id="uni_wrapper">
        <Header:Head ID="Header" runat="server" />
            <div id="uni_main">
             <!-- E_Header Navigation Menu --> 
	            <div id="content" class="clearfix">
		            <div id="group_750_l">
			            <div id="banner">
				            <div class="banner_ad_left">
				                <a href="#"><img src="Images/image_dd.png" width="465px" height="175px" border="2" style="border:1px solid Gray" align="left" /></a>
				            </div>				           
			            </div>	
			            <TimKiemCon2:TK2 ID="TK2" runat="server" />			            
			            <div id="ketquatimkiem" class="clearfix">
				            <div class="title_ketquatimkiem">
					            <p style="text-transform:uppercase">					            						            
                                    <asp:Label style="color: #FFFFFF; float: left; font-weight: bold; padding: 0px 0 0 8px; text-transform:uppercase;" ID="lbtb" runat="server" Text="Danh Sách Tin Theo Quận Huyện"></asp:Label>
					            </p>
				            </div>
				            <%  var obNewstin = getdatasource();
                                string query = null;
                                int page = 1;
                                query = Request.QueryString["page"];
                                if (query != null) { page = int.Parse(query); } %>
				            <div class="content">
					            <div id="show01">Kết quả : <%=page*10-10 %> - <% if (page * 10 <= gettotalpage())
                                                                  { %><%=page * 10%><%}
                                                                  else
                                                                  { %><%=gettotalpage()%><%} %> trong số <%=gettotalpage()%> tin</div>
					            <div id="show02">Sắp xếp theo:
						            <asp:DropDownList Width="122px" ID="dlsapxep" AutoPostBack="true" runat="server">
                                        <asp:ListItem Value="ngaydang">Ngày đăng mới nhất</asp:ListItem>
                                        <asp:ListItem Value="xemnhieu">Lượt Xem Nhiều Nhất</asp:ListItem>
                                    </asp:DropDownList>
					            </div>
				            </div>
			            </div>
		              <!-- e ket qua tim kiem-->
			             <div id="menu_timkiem">	
				            <div class="bg">
					            <ul>
						            <li style="width:100px;">Hình ảnh</li>
						            <li style="width:168px;">Thông Tin</li>
						            <li class="right" style="width:98px;">Ngày Đăng</li>
						            <li class="right" style="width:87px;">Nơi Đăng</li>
					            </ul>
				            </div> 
			             </div> 
			            <% int cout = 0;
                        foreach (var obNewsHouse in obNewstin)
                           {
                               cout += 1;
                                 %>
                                <div id="data_group_width_748">
                                <%if (cout < obNewstin.Count)
                                  { %>
				                    <div class="sub_data_group_width_748">
				                <%}
                                  else
                                  { %>
				                    <div class="sub_data_group_width_748" style="margin-bottom:0px;">
				                <%} %>
					                    <div class="img_width_100">
					                    <% if (obNewsHouse.UrlImage != "")
                            {
                                var listimage = obNewsHouse.UrlImage.Split('/');
                                string url = "";
                                foreach (var detail in listimage)
                                {
                                    if (checkurlimage(detail) == true)
                                    {
                                        url = "TotalUpload/ImagesTotal/" + detail;                                    
                                                            
                                                        
                                                     %><a href="TinNhaDatChiTiet.aspx?id=<%=obNewsHouse.NewsHouseID %>"><img src="<%=url %>" width="100px" height="100px" border="0" align="left" /></a><% break;
                                    }
                                }
                                if (url == "")
                                { %><a href="TinNhaDatChiTiet.aspx?id=<%=obNewsHouse.NewsHouseID %>"><img src="TotalUpload/ImagesTotal/noimage.gif" width="100px" height="100px" border="0" align="left" /></a>
                                            <% }
                            }
                            else
                            { %>
                                            <a href="TinNhaDatChiTiet.aspx?id=<%=obNewsHouse.NewsHouseID %>"><img src="TotalUpload/ImagesTotal/noimage.gif" width="100px" height="100px" border="0" align="left" /></a>
                                        <%} %></div>
					                    <div class="right_width_647">
						                    <div class="title_group_width_647">
							                    <span class="sub_title_left"><a href="TinNhaDatChiTiet.aspx?id=<%=obNewsHouse.NewsHouseID %>"><%=obNewsHouse.Title%></a></span>
							                    <span class="sub_title_right"><a href="TinNhaDatChiTiet.aspx?id=<%=obNewsHouse.NewsHouseID %>">chi tiết</a></span>
						                    </div>
						                    <div class="content_group_width_647">
							                    <table width="647" border="0" cellspacing="0" cellpadding="0">						
								                    <tr>
									                    <td valign="top" class="li_width_126" width="120"  bgcolor="#FFFFFF">
										                    <div class="li_width_126_01">
											                    Giá: <span class="spannormal"><%=obNewsHouse.Price%> <%=obNewsHouse.CurrencyName%></span><br>DT: <% if (obNewsHouse.SurfaceAreaHeight == obNewsHouse.SurfaceAreaWidth)
                                                                                                                                     { %><%=obNewsHouse.SurfaceAreaWidth%> m<sup>2</sup> <%} %> <%else
                             { %><%=obNewsHouse.SurfaceAreaWidth%> x <%=obNewsHouse.SurfaceAreaHeight%> (m x m)<%} %> <br />Vị trí: <%=obNewsHouse.AreaDetailName%><br>	
										                    </div>
									                    </td>
									                    <td valign="top" bgcolor="#FFFFFF" class="li_width_336">
										                    <div class="li_width_336_01" align="justify">
											                    <% if (obNewsHouse.NewsContent.Length > 200)
                                  {%>
                                                                <%=obNewsHouse.NewsContent.Substring(0, 199)%> ...
                                                            <%}
                                  else
                                  {%>
                                                             <%=obNewsHouse.NewsContent%>
                                                            <%} %><br />
											                    <span class="spannormal">Lượt xem: <b><%=obNewsHouse.ViewCount%></b>  |  								
												                    <span>
													                    <a href="XemTinTheoQuanHuyen.aspx?<%=Getlink() %>&save=<%=obNewsHouse.NewsHouseID %><%=getlinkpaging() %>">Lưu tin</a>
												                    </span>
											                    </span>
										                    </div>
									                    </td>
									                    <td valign="top" bgcolor="#FFFFFF" class="li_width_88">
										                    <div class="li_width_88_01">
										                        <%=obNewsHouse.AreaDetailName%><br />
												                <%=obNewsHouse.AreaName%><br />Đà Nẵng			
										                     </div>
									                    </td>
									                    <td valign="top" class="li_width_97">
										                    <div class="li_width_97_01">
										                        <%=obNewsHouse.CreatedDate.ToShortDateString()%>
										                    </div>
									                    </td>
								                    </tr>
							                    </table>																	
						                    </div>
					                    </div>
				                    </div>					                    																
			                    </div>
                                <%                           
                           }
	                       %>	
			            <div id="link">
				            <asp:Label ID="lblpaging" runat="server" Text=""></asp:Label>
			            </div>
		            </div>
		            <div id="group_5">
		                
			            <DanhMucNhaChoThue:CT ID="DanhMucNhaChoThue" runat="server" />
			            <NoiThat:NT ID="NoiThat" runat="server" />
			            <KhongGianSong:KGS ID="KhongGianSong" runat="server" />
		            </div>
	            <!--E_menu-->
	            </div>	
            </div>
            <MenuFooter:MeNuDuoi ID="MenuFooter" runat="server" />
            <Footer:Foot ID="Footer" runat="server" />
         </div>
    </form>
</body>
</html>
